package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-07-29
 * Time: 14:10
 */

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/sayhi")
    public String sayHi() {
        System.out.println("sayHi 方法：被执行了。");
        return "你好，世界。";
    }

    @RequestMapping("/sayhello")
    public String sayHello() throws InterruptedException {
        Thread.sleep(250);
        System.out.println("sayHello 方法：被执行了。");
//        int num = 10 / 0;
        return "世界，你好。";
    }

}
